package principle;

public class OCP {
    public static void main(String[] args) {
        GraphicEditor editor = new GraphicEditor();
        editor.draw(new Circle());
        editor.draw(new Triangle());
    }
}

abstract class Shape {
    public abstract void draw();
}

class GraphicEditor {
    public void draw(Shape s) {
        s.draw();
    }
}

class Circle extends Shape {

    @Override
    public void draw() {
        System.out.println("draw Circle");
    }
}

class Triangle extends Shape {

    @Override
    public void draw() {
        System.out.println("draw Triangle");
    }
}